<?php
/* Payment type */
echo '<h2>' . text::getEscaped('viregWizard.payment') . '</h2>';
echo '<p class="description">' . text::getEscaped('viregWizard.payment-desc') . '</p>';

echo form::comboBox('payment_type', $paymentTypeOptions, $paymentTypeForm, 'onchange="return viPaymentTypeChanged(this)"');

// Bank transfer
echo '<div id="paymentInfo-bank" class="' . ($paymentTypeForm['payment_type'] == 'bank' ? '' : 'hidden') . '">';
echo '<p>' . text::getEscaped('viregWizard.paymentInfo-bank') . '</p>';
$accountProperties = array('name', 'bank_name', 'number', 'bank_number', 'iban', 'swift');
echo '<table class="displayTable">';
echo '<tbody>';
foreach ($accountProperties as $property) {
    echo '<tr>';
    echo '<th><label>' . text::getEscaped('bankAccount.' . $property) . '</label></th>';
    echo '<td>' . $viSeminar['bankAccount'][$property] . '</td>';
    echo '</tr>';
}
echo '<tr>';
echo '<th><label>' . text::getEscaped('viSeminar.variable_symbol') . '</label></th>';
echo '<td>' . $viSeminar['variable_symbol'] . '</td>';
echo '</tr>';

$bankPaymentDiscount = $viSeminar['prices-' . ViregWizardData::$CURRENCY_CODE]['bank_payment_discount'];
if ($bankPaymentDiscount) {
    echo '<tr>';
    echo '<th><label>' . text::getEscaped('viSeminar.bank_payment_discount') . '</label></th>';
    echo '<td><span class="registrationPrice">' . format::price(-1 * $bankPaymentDiscount, ViregWizardData::$CURRENCY_CODE) . '</span></td>';
    echo '</tr>';
}

echo '</tbody>';
echo '</table>';

echo '</div>';

// Cash
echo '<p id="paymentInfo-cash" class="' . ($paymentTypeForm['payment_type'] == 'cash' ? '' : 'hidden') . '">' .
     text::get('viregWizard.paymentInfo-cash') .
     '</p>';

// Honorarium for instructors
echo '<p id="paymentInfo-honorarium" class="' . ($paymentTypeForm['payment_type'] == 'honorarium' ? '' : 'hidden') . '">' .
     text::get('viregWizard.paymentInfo-honorarium') .
     '</p>';

/* Notes */

echo '<h2>' . text::getEscaped('viregWizard.notes') . '</h2>';
echo '<p class="description">' . text::getEscaped('viregWizard.notes-desc') . '</p>';
echo form::textarea('notes', $paymentTypeForm['notes']);
